import {
  cusRequest
} from "../request.js"

export function getDetail(merchantId, productId) {
  return cusRequest({
    url: '/api/open/product/info',
    params: {
      merchantId: merchantId,
      productId: productId
    }
  })
}

export class Goods {
  constructor(detail) {
     this.presentPrice = detail.presentPrice;
     this.originalPrice = detail.originalPrice;
     this.productTitle = detail.productTitle;
     this.tags = detail.tags.split(",");
     this.productTypeName = detail.productTypeName;
  }
}

export class Shop {
  constructor(detail) {
     this.shopImg = detail.shopImg;
     this.shopName = detail.shopName;
     this.shopDescribe = detail.shopDescribe;
     this.saleCount = detail.saleCount;
  }
}
